//
//  TLVideoPlayer.h
//  FunnyVideo
//
//  Created by 李鑫 on 15/8/18.
//  Copyright © 2015年 NewEggTech. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

typedef enum : NSUInteger {
    TLVideoPlayerEventPause,
    TLVideoPlayerEventPlay,
    TLVideoPlayerEventFastForward,
    TLVideoPlayerEventRewindForward,
    TLVideoPlayerEventTypeValueChanged
} TLVideoPlayerEventType;

typedef enum : NSUInteger {
    TLPlayerDisplayModeFull,
    TLPlayerDisplayModeCenter,
} TLPlayerDisplayMode;

typedef enum : NSUInteger {
    TLPlayerStatusPlaying,
    TLPlayerStatusPaused,
    TLPlayerStatusUnLoaded,
} TLPlayerStatus;

typedef void (^VideoPlayerCallback)(TLVideoPlayerEventType eventType,float value);

@interface TLVideoPlayer : UIView 

@property (nonatomic,assign) float volume;
@property (nonatomic,strong) AVPlayer *videoPlayer;
@property (nonatomic,assign) TLPlayerStatus playerStatus;
@property (nonatomic,strong) NSURL *url;
@property (nonatomic,strong) NSString *v_id;

- (void)play;
- (void)pause;
- (void)reset;
- (void)setPlayerDisplayMode:(TLPlayerDisplayMode)displayMode;
- (void)addPlayerEventCallBack:(VideoPlayerCallback)block;
- (void)setVideoLayer:(AVPlayerLayer *)layer;
@end
